########################################################
# Snippets for INSTEAD (http://instead.googlecode.com) #
# Vim edition                                          #
# (Ultisnips)                                          #
# v0.2                                                 #
########################################################

# template

snippet insteadbegin "Meta information, etc" !
--$Name: ${1:Game name}
--$Author: ${2:Author name}
--$Version: ${3:0.1}

instead_version "1.4.2";

game.codepage = "${4:UTF-8}";
game.act = "${5:Не получается.}";
game.inv = "${6:Гм... Странная штука.}";
game.use = "${7:Не сработает...}";

main = room {
	${8:-- Room}
};$0
endsnippet

# One-letter snippets...
snippet r "Room carcass" !
= room {
	${1:-- Room}
};$0
endsnippet

snippet o "Obj carcass" !
= obj {
	${1:-- Object}
};$0
endsnippet

snippet d "Dialog carcass" !
= dlg {
	${1:-- Dialog}
};$0
endsnippet

snippet xr "Xroom carcass" !
= xroom {
	${1:-- Xroom}
};$0
endsnippet

snippet plr "Player carcass" !
= player {
	${1:-- Player}
};$0
endsnippet

snippet stat "Stat carcass" !
= stat {
	${1:-- Stat}
};$0
endsnippet

snippet menu "Menu carcass" !
= menu {
	${1:-- Menu}
};$0
endsnippet

snippet req "Require" !
require "${1:Module}";$0
endsnippet

snippet dofile "Dofile" !
dofile "${1:Filename}";$0
endsnippet

snippet doencfile "Doencfile" !
doencfile("${1:Encoded file}");$0
endsnippet

snippet init "Init()" !
function init()
	${1:-- Code}
end;$0
endsnippet

snippet nam "Nam" !
nam = [[${1:Name}]],$0
endsnippet

snippet dsc "Dsc" !
dsc = [[${1:Description}]],$0
endsnippet

snippet act "Act" !
act = [[${1:Use text}]],$0
endsnippet

snippet use "Use" !
use = [[${1:Use text}]],$0
endsnippet

snippet used "Used" !
used = [[${1:Used text}]],$0
endsnippet

snippet enter "Enter" !
enter = [[${1:Enter text}]],$0
endsnippet

snippet entered "Entered" !
entered = [[${1:Entered text}]],$0
endsnippet

snippet exit "Exit" !
exit = [[${1:Exit text}]],$0
endsnippet

snippet left "left" !
left = [[${1:Left text}]],$0
endsnippet

snippet inv "Inv" !
inv = [[${1:Inventory text}]],$0
endsnippet

snippet tak "Tak" !
tak = [[${1:Take text}]],$0
endsnippet

snippet disp "Disp" !
disp = [[${1:Display text}]],$0
endsnippet

snippet pic "Pic" !
pic = [[${1:gfx/pic.png}]],$0
endsnippet

snippet xdsc "Xdsc" !
xdsc = [[${1:Description}]],$0
endsnippet

snippet life "Life" !
life = [[${1:Life text}]],$0
endsnippet

snippet where "Where" !
where = [[${1:Where room}]],$0
endsnippet

snippet obj "Obj in Obj" !
obj = {
	${1:-- Objects}
},$0
endsnippet

snippet way "Way" !
way = {
	${1:-- Ways}
},$0
endsnippet

snippet var "Var" !
var {
	${1:-- Variables}
},$0
endsnippet

snippet global "Global" !
global {
	${1:-- Variables}
};$0
endsnippet

snippet hideinv "hideinv" !
hideinv = true;$0
endsnippet

snippet forcedsc "forcedsc" !
forcedsc = true;$0
endsnippet

snippet func "= function()" !
= function()
	${1:-- Code}
end,$0
endsnippet

snippet funcs "= function(s)" !
= function(s)
	${1:-- Code}
end,$0
endsnippet

snippet funcsw "= function(s, w)" !
= function(s, w)
	${1:-- Code}
end,$0
endsnippet

snippet function "function ... ()" !
function ${1:Function_name} (${2:Params})
	${3:-- Code}
end;$0
endsnippet

snippet phr "Phrase" !
[${1:Number}] = phr(${2:You phrase}, ${3:Other phrase}, [[${4:Code}]]),$0
endsnippet

snippet _phr "_Phrase" !
[${1:Number}] = _phr(${2:You phrase}, ${3:Other phrase}, [[${4:Code}]]),$0
endsnippet

snippet if "If ..." !
if ${1:Expression} then
	${2:-- Code}
${3:elseif ${4:Expression} then
	${5:-- Code}}
${6:else
	${7:-- Code}}
end;$0
endsnippet

snippet ifend "If ... end;" !
if ${1:Expression} then
	${2:-- Code}
end;$0
endsnippet

snippet ifel "if ... else ... end;" !
if ${1:Expression} then
	${2:-- Code}
else
	${3:-- Code}
end;$0
endsnippet

snippet elif "elseif ..." !
elseif ${1:Expression} then
	${0:-- Code}
endsnippet

snippet elifend "elseif ... end;" !
elseif ${1:Expression} then
	${2:-- Code}
end;$0
endsnippet

snippet ret "Return" !
return ${1:True};$0
endsnippet

snippet xact "Xact" !
xact(${1:Name}, ${2:Text or code}),$0
endsnippet

snippet p "p [[...]]" !
p [[${1:Text}]];$0
endsnippet

snippet code "code[[...]]" !
code[[${1:-- Code}]]$0
endsnippet

snippet click "click" !
click = function(s, x, y)
	${1:-- Code}
end,
endsnippet
